import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

import Home from "@/pages/Home/index.vue";
import PalyGame from "@/pages/playgame/index.vue";
import Kai from "@/pages/Kai/index.vue";
import SiV from "@/components/SiV.vue";
import BiliVipShop from "@/pages/biliVipShop/biliVipShop.vue";
import Cartoon from "@/pages/Cartoon/index.vue";
import ComPon from "@/pages/playgame/compon/index.vue";
import MessageBoard from "@/pages/playgame/MessageBoard/index.vue";
import LoginCenter from "@/pages/loginCenter/LoginCenter.vue";
import VideoDetail from "@/pages/VideoDetail/index.vue";
import Homepage from "@/pages/Cartoon/Homepage/index.vue";
import PPP from "@/pages//Cartoon/ComicClassify/index.vue";
Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/",
      redirect: "/Home",
      component: Home,
    },
    {
      path: "/bilivipshop",
      name: "biliVipShop",
      component: BiliVipShop,
      meta: {
        isHidden: true,
      },
    },
    {
      path: "/playgame",
      component: PalyGame,
      children: [
        {
          path: "/playgame/messageboard",
          name: "MessageBoard",
          component: MessageBoard,
          meta: {
            isHidden: true,
          },
        },
        {
          path: "/playgame",
          name: "ComPon",
          component: ComPon,
          meta: {
            isHidden: true,
          },
        },
      ],
      meta: {
        isHidden: true,
      },
    },
    {
      path: "/kai",
      component: Kai,
      meta: {
        isHidden: true,
      },
    },
    // 漫画路由
    {
      path: "/cartoon",
      component: Cartoon,
      children: [
        {
          path: "/cartoon/homepage",
          name: "Homepage",
          component: Homepage,
        },
        {
          path: "/cartoon/comicclassify",
          name: "ComicClassify",
          component: PPP,
        },
      ],
    },
    {
      path: "/logincenter",
      component: LoginCenter,
    },
    {
      path: "/videoDetail",
      component: VideoDetail,
    },
    {
      path: "/cartoon",
      component: Cartoon,
    },
    // 重定向 如果现在是/（根路径） 那么重定向到/home 从而展示Home组件
    {
      path: "/Home",
      name: "home",
      component: Home,
      meta: {
        hidden: true,
      },
      children: [
        {
          path: "/Home/siv",
          name: "siv",
          component: SiV,
        },
      ],
    },
  ],
  // 滚动行为：当路由组件切换时滚动条的位置
});

// 导出路由
export default router;
